import request from '@/utils/request'

/**
 * 获取企业列表
 * @param {*} params 
 * @returns 
 */
export const getEnterpriseListAPI = (params) => {
    return request({
        url: '/park/enterprise',
        method: 'GET',
        params
    })
}

/**
 * 获取行业列表
 * @returns 
 */
export const getIndustryListAPI = () => {
    return request({
        url: '/park/industry',
        method: 'GET'
    })
}

/**
 * 上传合同
 * @param {*} data 
 * @returns 
 */
export const uploadAPI = (data) => {
    return request({
        url: '/upload',
        method: 'POST',
        data
    })
}

/**
 * 创建公司
 * @param {*} data 
 * @returns 
 */
export const createExterpriseAPI = (data) => {
    return request({
        url: '/park/enterprise',
        method: 'POST',
        data
    })
}

/**
 * 获取企业详情
 * @param {*} id 
 * @returns 
 */
export const getEnterpriseDetailAPI = (id) => {
    return request({
        url: `/park/enterprise/${id}`,
        method: 'GET'
    })
}

/**
 * 更新企业
 * @param {*} data 
 * @returns 
 */
export const updateExterpriseAPI = (data) => {
    return request({
        url: '/park/enterprise',
        method: 'PUT',
        data
    })
}

/**
 * 删除企业
 * @param {*} id 
 * @returns 
 */
export const delExterpriseAPI = (id) => {
    return request({
        url: `/park/enterprise/${id}`,
        method: 'DELETE'
    })
}

/**
 * 获取楼宇列表
 * @returns 
 */
export const getRentBuildListAPI = () => {
    return request({
        url: '/park/rent/building',
        method: 'GET'
    })
}

/**
 * 创建合同
 * @param {*} data 
 * @returns 
 */
export const createRentAPI = (data) => {
    return request({
        url: '/park/enterprise/rent',
        method: 'POST',
        data
    })
}

/**
 * 获取合同列表
 * @param {*} id 
 * @returns 
 */
export const getRentListAPI = (id) => {
    return request({
        url: `/park/enterprise/rent/${id}`,
        method: 'GET'
    })
}

/**
 * 退租
 * @param {*} rentId 
 * @returns 
 */
export const outRentAPI = (rentId) => {
    return request({
        url: `/park/enterprise/rent/${rentId}`,
        method: 'PUT'
    })
}

/**
 * 获取详情
 * @param {*} id 
 * @returns 
 */
export const getEnterpriseDetail = (id) => {
    return request({
        url: `/park/enterprise/${id}`,
        method: 'GET'
    })
}

/**
 * 创建规则
 * @returns
 */
export const createRuleAPI = (data) => {
    return request({
        url: '/parking/rule',
        method: 'POST',
        data
    })
}
